﻿using Abp.Domain.Entities.Auditing;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MyCompanyName.AbpZeroTemplate.Prm.Project
{
    public class ProjectInfo : FullAuditedEntity<int>
    {
        /// <summary>
        /// 项目状态
        /// </summary>
        public virtual Status Status
        {
            get;
            set;
        }

        /// <summary>
        /// 项目进展状态
        /// </summary>
        public virtual ProgressStatus ProgressStatus
        {
            get;
            set;
        }

        /// <summary>
        /// 项目编号
        /// </summary>
        public virtual string ProjectNo { get; set; }

        /// <summary>
        /// 项目名称
        /// </summary>

        public virtual string ProjectName { get; set; }



        /// <summary>
        /// 产品号
        /// </summary>
        public virtual string ProductNo
        {
            get;
            set;
        }

        ///// <summary>
        ///// 物质Id
        ///// </summary>
        //public virtual int SubstanceId { get; set; }

        ///// <summary>
        ///// 产品Id
        ///// </summary>
        //public virtual int ProductId { get; set; }



        /// <summary>
        /// 中试地点
        /// </summary>
        public virtual string Address
        {
            get;
            set;
        }

        /// <summary>
        /// 客户
        /// </summary>
        public virtual string Customer
        {
            get;
            set;
        }

        /// <summary>
        /// 研发中心
        /// </summary>
        public virtual string BU
        {
            get;
            set;
        }
        /// <summary>
        /// 研发中心
        /// </summary>
        public virtual string RdCenter
        {
            get;
            set;
        }

        /// <summary>
        /// 研究室
        /// </summary>
        public virtual string Lab
        {
            get;
            set;
        }


        /// <summary>
        /// 客户对化合物的编号
        /// </summary>
        public virtual string CustomeCode
        {
            get;
            set;
        }

        /// <summary>
        /// 质量标准
        /// </summary>
        public virtual string QualityStandard { get; set; }


        /// <summary>
        /// 项目任务
        /// </summary>
        public virtual TaskType TaskType
        {
            get;
            set;
        }

        /// <summary>
        /// 项目性质
        /// </summary>
        public virtual string ProjectNature
        {
            get;
            set;
        }


        /// <summary>
        /// 实际项目成本
        /// </summary>
        public virtual decimal ActualCost
        {
            get;
            set;
        }

        /// <summary>
        /// 实际人力成本
        /// </summary>
        public virtual decimal ActualWorkCost
        {
            get;
            set;
        }
        /// <summary>
        /// 计划人力成本
        /// </summary>
        public virtual decimal TargetWorkCost
        {
            get;
            set;
        }

        /// <summary>
        /// 实际完成量
        /// </summary>
        public virtual decimal ActualOutPut
        {
            get;
            set;
        }

        /// <summary>
        /// 实际原料成本
        /// </summary>
        public virtual decimal ActualMaterialCost
        {
            get;
            set;
        }

        /// <summary>
        /// 目标项目成本
        /// </summary>
        public virtual decimal TargetCost
        {
            get;
            set;
        }
        /// <summary>
        /// 目标完成量
        /// </summary>
        public virtual decimal TargetOutPut
        {
            get;
            set;
        }
        /// <summary>
        /// 目标原料成本
        /// </summary>
        public virtual decimal TargetMaterialCost
        {
            get;
            set;
        }



        /// <summary>
        /// 计划开始时间
        /// </summary>
        public virtual DateTime PlanStartDate
        {
            get;
            set;
        }
        /// <summary>
        /// 计划结束时间
        /// </summary>
        public virtual DateTime PlanEndDate
        {
            get;
            set;
        }
        /// <summary>
        /// 客户要求完成时间
        /// </summary>
        public virtual DateTime TargetEndDate
        {
            get;
            set;
        }





        /// <summary>
        /// 实际开始时间
        /// </summary>
        public virtual DateTime ActualStartDate
        {
            get;
            set;
        }
        /// <summary>
        /// 实际（预期）结束时间
        /// </summary>
        public virtual DateTime ActualEndDate
        {
            get;
            set;
        }


        public virtual string Remark { get; set; }


        /// <summary>
        /// 团队评价状态
        /// </summary>
        public virtual CommentStatus TeamCommentStatus { get; set; }


        /// <summary>
        /// 项目评价状态
        /// </summary>
        public virtual CommentStatus PrmCommentStatus { get; set; }


        [ForeignKey("ProjectId")]
        public virtual ICollection<ProjectProgress> ProjectProgress { get; set; }

        [ForeignKey("ProjectId")]
        public virtual ICollection<ProjectTeam> ProjectTeam { get; set; }
    }


    public enum CommentStatus
    {
        草稿 = 10,
        已提交 = 20
    }

    public enum Status
    {
        进行中 = 10,
        完成 = 20,
        暂停 = 30,
        终止 = 40,
        准备 = 50
    }

    /// <summary>
    /// 项目进度状态
    /// </summary>
    public enum ProgressStatus
    {
        正常 = 10,
        延期 = 20,
        提前 = 30
    }

    public enum TaskType
    {
        小试,
        中试,
        其它
    }


}
